<?php
/**
 * Created by PhpStorm.
 * User: admin
 * Date: 2019/10/23
 * Time: 13:47
 */

namespace app\adminapiv3\service;


class HostAddress extends Base
{
    /**
     * @name 列表
     * @param $params
     * @param int $limit
     * @return array
     * @author wx
     * @date 2019/10/23 14:54
     */
    function list($params, $limit = 10)
    {
        $server = new \app\common\service\HostAddress();
        $data = $server->list($params, $limit);

        return $data;
    }

    /**
     * @name 添加
     * @param $addData
     * @return bool
     * @author wx
     * @date 2019/10/23 14:54
     */
    function add($addData)
    {
        $server = new \app\common\service\HostAddress();
        $addData['ctime'] = time();
        $server->add($addData);

        return true;
    }

    /**
     * @name 修改
     * @param $id
     * @param $addData
     * @return bool
     * @author wx
     * @date 2019/10/23 14:54
     */
    function modify($id, $addData)
    {
        $server = new \app\common\service\HostAddress();
        $server->modify(['id' => $id], $addData);

        return true;
    }

    /**
     * @name 删除
     * @param $id
     * @author wx
     * @date 2019/10/23 14:54
     */
    function del($id)
    {
        $condition[] = array('id', 'in', $id);
        $server = new \app\common\service\HostAddress();
        $server->del($condition);
    }
}